package core;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import core.entities.*;

/**
 * Class modeling the currents Cards which appear in the table stock
 * 
 * @author Nolan Potier
 * @version 1.0.0
 * 
 */
public abstract class Cards {

    /**
     * The current cards
     */
    private List<Card> cards;
    
    /**
     * First constructor 
     * 
     */
    public Cards() {
        cards = new ArrayList<Card>();
    }

    /**
     * Second constructor
     * 
     * @param cards
     *              the targeted cards associated
     */
    public Cards(List<Card> cards) {
        this.cards = new ArrayList<Card>();
        addCards(cards);
    }

    /**
     * @param cards
     *               add cards to the currents cards
     */
    public void addCards(List<Card> cards) {
        this.cards.addAll(cards);
    }
    
    /**
     * @param cards
     *               add cards to the currents cards
     */
    public void addCards(Cards cards) {
        this.cards.addAll(cards.cards);
    }
    
    /**
     * @param cards
     *               add card to the currents cards
     */
    public void addCard(Card card) {
        this.cards.add(card);
    }

    /**
     * @return the currents cards
     */
    public List<Card> getCards() {
        return cards;
    }
    
    /**
     * shuffle method<BR />
     * Cards shuffling method. This method shuffles
     * the cards ensemble represented by this
     * object.
     */
    public void shuffle() {
    	Collections.shuffle(cards);
    }
    
    /**
     * isEmpty method<BR />
     * Returns <code>true</code> if this list contains
     * no elements.
     * @return <code>true</code> if this list contains no elements
     */
    public boolean isEmpty() {
    	return cards.isEmpty();
    }
}
